package rsschart.action;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HomerExample extends HttpServlet {

	protected void service(HttpServletRequest request, HttpServletResponse response) 
	throws ServletException, IOException {

	request.setAttribute("chartTitle", "Team Home Run Tally");
	request.setAttribute("catgName", "Year");
	request.setAttribute("catgVals","2002:2003:2004:2005:2006");
	request.setAttribute("dataSetsName","Players");
	request.setAttribute("dataSetsValueLabel","Home Run Count");
	
	List dataSetMaps = new ArrayList();
	Map dataSetMap; 
	
	dataSetMap = new HashMap();
	dataSetMap.put("idx", "1");
	dataSetMap.put("name", "Hank");
	dataSetMap.put("val", "32:35:34:38:33");
	dataSetMaps.add(dataSetMap);
	
	dataSetMap = new HashMap();
	dataSetMap.put("idx", "2");
	dataSetMap.put("name", "Willie");
	dataSetMap.put("val", "37:39:40:36:35");
	dataSetMaps.add(dataSetMap);

	dataSetMap = new HashMap();
	dataSetMap.put("idx", "3");
	dataSetMap.put("name", "George");
	dataSetMap.put("val", "40:41:37:37:39");
	dataSetMaps.add(dataSetMap);

	request.setAttribute("dataSetMaps",dataSetMaps);
	request.setAttribute("setCount","3");
	request.setAttribute("pointCount","5");
	
	RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/content.jsp");
	dispatcher.forward(request, response);

}


	
	
}
